Traditionally, a Single Photon Avalanche Diode (SPAD) is applied as an image sensor to count the incident photons, or is applied to a Time-of-flight (ToF) application by applying a Time-to-Digital Converter (TDC) to measure the travel time of the photons. For each of the aforementioned applications, a specific readout circuit must be applied. In the testing procedure, however, the pin count and chip area are limited in a miniature size application. For example, a scribe line testing application or an Internet of Thing application. Therefore, a novel architecture of the readout circuit is desired for a SPAD applied to different applications at the same time to solve the aforementioned problems.